package com.huluobo.a2109monthdemo.category

import android.util.Log
import androidx.lifecycle.ViewModelProvider
import com.huluobo.a2109monthdemo.R
import com.huluobo.a2109monthdemo.base.BaseMVVMFragment
import com.huluobo.a2109monthdemo.databinding.FragmentCategoryBinding

class CategoryFragment : BaseMVVMFragment<FragmentCategoryBinding>() {
    private lateinit var viewModel: CategoryViewModel
    override fun getLayoutId(): Int = R.layout.fragment_category

    override fun initData() {
        viewModel = ViewModelProvider(requireActivity())[CategoryViewModel::class.java]
        viewModel.getCategory()

        viewModel.categorySuccess.observe(this) {
            Log.i("TagA", "parent:${it.data.size}")
            Log.i("TagA", "child:${it.data[0].data?.size}")
        }
    }

    override fun initView() {
    }
}